package edu.cmu.vlis.datamining.SimilarityFeatures;

import org.jgrapht.alg.KShortestPaths;
import org.jgrapht.graph.DefaultDirectedWeightedGraph;

import edu.cmu.vlis.datamining.core.Edge;
import edu.cmu.vlis.datamining.core.Feature;
import edu.cmu.vlis.datamining.core.IFeatureCalculator;
import edu.cmu.vlis.datamining.core.Vertex;

/**
 * The Katz graph distance measure:
   sum(BiNi), where Ni is the number of unique
   paths of length i between the two nodes, and
   B is a decay parameter between 0 and 1. 
   
   Not yet implemented
 */
public class KatzMeasure implements IFeatureCalculator{

    private DefaultDirectedWeightedGraph<Vertex, Edge> _graph;
    private KShortestPaths<Vertex, Edge> shortPathCalculator;
    private int featureId;
    
    public KatzMeasure(DefaultDirectedWeightedGraph<Vertex, Edge> graph){

        this._graph = graph;
        this.featureId = 3;

    }
    
    public Feature compute(Vertex a, Vertex b) {
        this.shortPathCalculator = new KShortestPaths<Vertex, Edge>(this._graph,a,1000,5);   
        this.shortPathCalculator.getPaths(b);
        return new Feature(this.featureId,0);
    }

    
}
